//存放用到的常量，项目根目录的绝对路径，开发服务器的端口路径，项目名称等等。
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// 拼接绝对路径
const PROJECT_PATH = path.resolve(__dirname, '../');

// 项目名
const PROJECT_NAME = path.parse(PROJECT_PATH).name;

// 是否是开发环境
const isDev = process.env.NODE_ENV !== 'production';

// host
const SERVER_HOST = '127.0.0.1';

// 端口
const SERVER_PORT = 9000;

export {
    isDev,
    PROJECT_PATH,
    PROJECT_NAME,
    SERVER_HOST,
    SERVER_PORT,
};